package com.SouthernWall_404.Age_Capitalism.Client;

import com.SouthernWall_404.Age_Capitalism.AgeCapitalism;
import com.SouthernWall_404.Age_Capitalism.Client.Gui.Screen.ModMerchantScreen;
import com.SouthernWall_404.Age_Capitalism.Client.Gui.Screen.ModSettingMerchantScreen;
import com.SouthernWall_404.Age_Capitalism.Client.Render.HighlightBlockEntityRenderer;
import com.SouthernWall_404.Age_Capitalism.common.Init.ModBlockEntities;
import com.SouthernWall_404.Age_Capitalism.common.Init.ModBlocks;
import com.SouthernWall_404.Age_Capitalism.common.Init.ModMenuType;
import net.minecraft.client.gui.screens.MenuScreens;
import net.minecraft.client.renderer.ItemBlockRenderTypes;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.blockentity.BlockEntityRenderers;
import net.minecraft.world.entity.Display;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;

@Mod.EventBusSubscriber(modid = AgeCapitalism.MODID,bus = Mod.EventBusSubscriber.Bus.MOD,value = Dist.CLIENT)
public class AgeBayonetClient {

    @SubscribeEvent
    public static void onClientSetUp(FMLClientSetupEvent event)
    {
        IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
        MenuScreens.register(ModMenuType.MOD_MERCHANT_MENU.get(), ModMerchantScreen::new);
        MenuScreens.register(ModMenuType.MOD_SETTING_MERCHANT_MENU.get(), ModSettingMerchantScreen::new);


    }

    @SubscribeEvent
    public static void onClientSetup(FMLClientSetupEvent event) {
        event.enqueueWork(() -> {
            BlockEntityRenderers.register(
                    ModBlockEntities.STORE_BLOCK_ENTITY.get(),
                    (a)->new HighlightBlockEntityRenderer(a));

            ItemBlockRenderTypes.setRenderLayer(ModBlocks.STORE_BLOCK.get(), RenderType.cutout());

//            );
        });
    }




}
